<script setup name="ChannelSelect">
import { articleGetChannelService } from '@/api/article'
import { ref } from 'vue'
/**
 * 文章分类
 */
const channelList = ref([])
const getChannelList = async () => {
  const res = await articleGetChannelService()
  channelList.value = res.data
}
getChannelList()
// 父组件传值
const model = defineModel()
defineProps({
  width: {
    type: String,
  },
})
</script>

<template>
  <el-select size="large" style="width: 240px" v-model="model" :style="{ width }">
    <el-option
      v-for="channel in channelList"
      :key="channel.id"
      :label="channel.cate_name"
      :value="channel.id"
    ></el-option>
  </el-select>
</template>

<style scoped></style>
